<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="实验数据编号">
              <a-input placeholder="请输入实验数据编号" v-model="queryParam.testCode"></a-input>
            </a-form-item>
          </a-col>
          <a-col :md="12" :sm="16">
            <a-form-item label="监测时间">
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择开始时间" class="query-group-cust" v-model="queryParam.checkTime_begin"></j-date>
              <span class="query-group-split-cust"></span>
              <j-date :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择结束时间" class="query-group-cust" v-model="queryParam.checkTime_end"></j-date>
            </a-form-item>
          </a-col>
          <a-col :md="6" :sm="8" >
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
            </span>
          </a-col>

        </a-row>
      </a-form>
    </div>
    
    <!-- 操作按钮区域 -->

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">
        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">查看</a>
        </span>
      </a-table>
    </div>

    <zxjEipDnbDbcs-modal ref="modalForm" @ok="modalFormOk"></zxjEipDnbDbcs-modal>
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import ZxjEipDnbDbcsModal from './modules/ZxjEipDnbDbcsModal'
  import JDate from '@/components/jeecg/JDate.vue'
  export default {
    name: "ZxjEipDnbDbcsList",
    mixins:[JeecgListMixin],
    components: {
      ZxjEipDnbDbcsModal,
      JDate
    },
    data () {
      return {
        description: '单板测试管理页面',
        // 表头
        columns: [
          {
            title: '序号',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'是否上传',
            align:"center",
            dataIndex: 'ioflag',
            customRender:function (text) {
              if(text===1){
                return '未上传'
              }else {
                return '已上传'
              }
            }
          },
          {
            title:'供应商编号',
            align:"center",
            dataIndex: 'supplierCode'
          },
          {
            title:'生产订单编号',
            align:"center",
            dataIndex: 'productionOrderId'
          },
          {
            title:'工单号',
            align:"center",
            dataIndex: 'workOrderCode'
          },
          {
            title:'实验数据编号',
            align:"center",
            dataIndex: 'testCode'
          },
          {
            title:'厂内编号',
            align:"center",
            dataIndex: 'plantCode'
          },
          {
            title:'电路板编号',
            align:"center",
            dataIndex: 'pcbCode'
          },
          {
            title:'监测时间',
            align:"center",
            dataIndex: 'checkTime'
          },
          {
            title:'软件版本号',
            align:"center",
            dataIndex: 'softwareVersion'
          },
          {
            title:'监测结论',
            align:"center",
            dataIndex: 'conclusion',
            customRender:function (text) {
              if(text===1){
                return '不合格'
              }else {
                return '合格'
              }
            }
          },
          {
            title:'创建时间',
            align:"center",
            dataIndex: 'createTime'
          },

          {
            title:'数据信息类型',
            align:"center",
            dataIndex: 'infoTypeCode'
          },
          {
            title:'抓取时间',
            align:"center",
            dataIndex: 'grabTime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' },
          }
        ],
        url: {
          list: "/zxjEipDnbDbcs/list",
          delete: "/zxjeipdbcs/zxjEipDnbDbcs/delete",
          deleteBatch: "/zxjeipdbcs/zxjEipDnbDbcs/deleteBatch",
          exportXlsUrl: "/zxjeipdbcs/zxjEipDnbDbcs/exportXls",
          importExcelUrl: "zxjeipdbcs/zxjEipDnbDbcs/importExcel",
        },
        dictOptions:{
        } 
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      }
       
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>